package com.stm.bi.dto.query;

import com.stm.bi.enums.GroupType;
import com.stm.framework.annotation.ReqParam;

public class GroupField {

    @ReqParam(label = "字段名")
    private String fieldName;

    @ReqParam(label = "聚合类型", enumClass = GroupType.class)
    private String groupType;

    public static GroupField of (String fieldName, String groupType) {
        GroupField groupField = new GroupField();
        groupField.setFieldName(fieldName);
        groupField.setGroupType(groupType);
        return groupField;
    }

    public String getFieldName() {
        return fieldName;
    }

    public GroupField setFieldName(String fieldName) {
        this.fieldName = fieldName;
        return this;
    }

    public String getGroupType() {
        return groupType;
    }

    public GroupField setGroupType(String groupType) {
        this.groupType = groupType;
        return this;
    }
}
